home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.awt.event.ActionEvent;
- import javax.swing.AbstractAction;
-
- public class BasicTreeUI$TreeIncrementAction extends AbstractAction {
- // $FF: synthetic field
- private final BasicTreeUI this$0;
- protected int direction;
- private boolean addToSelection;
- private boolean changeSelection;
-
- public BasicTreeUI$TreeIncrementAction(BasicTreeUI var1, int var2, String var3) {
- this(var1, var2, var3, false, true);
- }
-
- private BasicTreeUI$TreeIncrementAction(BasicTreeUI var1, int var2, String var3, boolean var4, boolean var5) {
- this.this$0 = var1;
- this.direction = var2;
- this.addToSelection = var4;
- this.changeSelection = var5;
- }
-
- // $FF: synthetic method
- BasicTreeUI$TreeIncrementAction(BasicTreeUI var1, BasicTreeUI.1 var2, int var3, String var4, boolean var5, boolean var6) {
- this(var1, var3, var4, var5, var6);
- }
-
- public void actionPerformed(ActionEvent var1) {
- int var2;
- if (this.this$0.tree != null && this.this$0.treeSelectionModel != null && (var2 = this.this$0.getRowCount(this.this$0.tree)) > 0) {
- int var3 = BasicTreeUI.access$5(this.this$0);
- int var4;
- if (var3 == -1) {
- if (this.direction == 1) {
- var4 = 0;
- } else {
- var4 = var2 - 1;
- }
- } else {
- var4 = Math.min(var2 - 1, Math.max(0, var3 + this.direction));
- }
-
- if (this.addToSelection) {
- BasicTreeUI.access$7(this.this$0, this.this$0.getPathForRow(this.this$0.tree, var4));
- } else if (this.changeSelection) {
- this.this$0.tree.setSelectionInterval(var4, var4);
- } else {
- BasicTreeUI.access$6(this.this$0, this.this$0.getPathForRow(this.this$0.tree, var4), true);
- }
-
- this.this$0.ensureRowsAreVisible(var4, var4);
- this.this$0.lastSelectedRow = var4;
- }
-
- }
-
- public boolean isEnabled() {
- return this.this$0.tree != null && this.this$0.tree.isEnabled();
- }
- }
-